package models.ru.paralainer.chat.server.dao.impl;

import javax.persistence.Query;

import models.ru.paralainer.chat.server.dao.UserDAO;
import models.ru.paralainer.chat.server.domain.User;
import play.db.jpa.JPA;

/**
 * User: stalov
 * Date: 25.05.12
 * Time: 16:13
 */
public class UserDAOImpl extends GenericDAOImpl<User> implements UserDAO {

    public User findByUsername(String username) {
        Query query = JPA.em().createNamedQuery("User.findByUsername");
        query.setParameter("username", username);
        return singleResult(query);
    }

}
